import java.util.ArrayList;

//-Xms 设置初始化内存分配大小 默认1/64
//-Xmx 设置最大分配内存，默认 1/4
//-XX:+PrintGCDetails //打印CG垃圾回收信息
//-XX:+HeapDumpOnOutOfMemoryError //oo, DUMP
//-Xms1m -Xms8m -XX:+HeapDumpOnOutOfMemoryError
public class Demo03 {

    byte[] array = new byte[1 * 1024 * 10234];//1m

    public static void main(String[] args) {
        ArrayList<Demo03> list = new ArrayList<>();
        int count = 0;

        try {
            while (true) {
                list.add(new Demo03());
                count = count + 1;
            }
        } catch (Exception e) {
            System.out.println("count:" + count);
            e.printStackTrace();
        }
    }
}
